import request from '@/utils/request'

/**
 * 获取图形验证码
 * @param {*} params
 */
export function getVerify(params) {
  return request({
    url: '/PassportApi/verify',
    responseType: 'arraybuffer',
    method: 'get',
    params
  })
}

/**
 * 登录提交
 * @param {*} data
 */
export function postLogin(data) {
  return request({
    url: '/PassportApi/loginByNormal',
    method: 'post',
    data
  })
}

/**
 * 获取注册页初始数据
 * @param {*} params
 */
export function getRegInfo(params) {
  return request({
    url: '/PassportApi/regInfo',
    method: 'get',
    params
  })
}

/**
 * 获取短信验证码
 * @param {*} params
 */
export function postMsgVerify(data) {
  return request({
    url: '/PassportApi/sendCode',
    method: 'post',
    data
  })
}

/**
 * 验证手机号码是否已注册
 * @param {*} data
 */
export function postIsMobileExist(data) {
  return request({
    url: '/PassportApi/isMobileExist',
    method: 'post',
    data
  })
}

/**
 * 注册提交
 * @param {*} data
 */
export function postReg(data) {
  return request({
    url: '/PassportApi/regDo',
    method: 'post',
    data
  })
}

// 忘记密码
export function postForget(data) {
  return request({
    url: '/ShopApi/forgetDo',
    method: 'post',
    data
  })
}

/**
 * 短信验证码登录
 * @param {*} params
 */
 export function postLoginBySms(data) {
  return request({
    url: '/PassportApi/loginBySms',
    method: 'post',
    data
  })
}
// 获取海报
export function getPoster(data) {
  return request({
    url: '/ApplicationPoster/get_poster',
    method: 'post',
    data
  })
}